using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._Hydrology
{
    /// <summary>
    /// <para>Flow Accumulation</para>
    /// <para>Creates a raster of accumulated flow into each cell.</para>
    /// <para>创建流入每个像元的累积流量栅格。</para>
    /// </summary>    
    [DisplayName("Flow Accumulation")]
    public class FlowAccumulation : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FlowAccumulation()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputFlowDirectionRaster">
        /// <para>Input Flow Direction Raster</para>
        /// <para><xdoc>
        ///   <para>The input raster that shows the direction of flow out of each cell.</para>
        ///   <para>The flow direction raster can be created using the D8, MFD, or DINF method. Use the Flow Direction Type parameter to specify the method used when the flow direction raster was created.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>显示流出每个像元的方向的输入栅格。</para>
        ///   <para>可以使用 D8、MFD 或 DINF 方法创建流向栅格。使用流向类型参数指定创建流向栅格时使用的方法。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_outputName">
        /// <para>Output Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output flow accumulation raster service.</para>
        ///   <para>The default name is based on the tool name and the input layer name. If the layer name already exists, you will be prompted to provide another name.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出流累积栅格服务的名称。</para>
        ///   <para>默认名称基于工具名称和输入图层名称。如果图层名称已存在，系统将提示您提供其他名称。</para>
        /// </xdoc></para>
        /// </param>
        public FlowAccumulation(object _inputFlowDirectionRaster, object _outputName)
        {
            this._inputFlowDirectionRaster = _inputFlowDirectionRaster;
            this._outputName = _outputName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Flow Accumulation";

        public override string CallName => "ra.FlowAccumulation";

        public override List<string> AcceptEnvironments => ["cellSize", "extent", "mask", "outputCoordinateSystem", "snapRaster"];

        public override object[] ParameterInfo => [_inputFlowDirectionRaster, _outputName, _inputWeightRaster, _dataType.GetGPValue(), _flowDirectionType.GetGPValue(), _outputRaster];

        /// <summary>
        /// <para>Input Flow Direction Raster</para>
        /// <para><xdoc>
        ///   <para>The input raster that shows the direction of flow out of each cell.</para>
        ///   <para>The flow direction raster can be created using the D8, MFD, or DINF method. Use the Flow Direction Type parameter to specify the method used when the flow direction raster was created.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>显示流出每个像元的方向的输入栅格。</para>
        ///   <para>可以使用 D8、MFD 或 DINF 方法创建流向栅格。使用流向类型参数指定创建流向栅格时使用的方法。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Flow Direction Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputFlowDirectionRaster { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output flow accumulation raster service.</para>
        ///   <para>The default name is based on the tool name and the input layer name. If the layer name already exists, you will be prompted to provide another name.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出流累积栅格服务的名称。</para>
        ///   <para>默认名称基于工具名称和输入图层名称。如果图层名称已存在，系统将提示您提供其他名称。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputName { get; set; }


        /// <summary>
        /// <para>Input Weight Raster</para>
        /// <para>An optional integer input raster for applying a weight to each cell.</para>
        /// <para>用于对每个像元应用权重的可选整数输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Weight Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _inputWeightRaster { get; set; } = null;


        /// <summary>
        /// <para>Output Data Type</para>
        /// <para><xdoc>
        ///   <para>The output accumulation raster can be integer, floating or double type.</para>
        ///   <bulletList>
        ///     <bullet_item>Float—The output raster will be floating point type. This is the default.</bullet_item><para/>
        ///     <bullet_item>Integer—The output raster will be integer type.</bullet_item><para/>
        ///     <bullet_item>Double—The output raster will be double type.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出累积栅格可以是整数、浮点或双精度类型。</para>
        ///   <bulletList>
        ///     <bullet_item>浮点型—输出栅格将为浮点型。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>整数—输出栅格将为整数类型。</bullet_item><para/>
        ///     <bullet_item>双精度—输出栅格将为双精度类型。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Data Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _dataType_value _dataType { get; set; } = _dataType_value._FLOAT;

        public enum _dataType_value
        {
            /// <summary>
            /// <para>Float</para>
            /// <para>Float—The output raster will be floating point type. This is the default.</para>
            /// <para>浮点型—输出栅格将为浮点型。这是默认设置。</para>
            /// </summary>
            [Description("Float")]
            [GPEnumValue("FLOAT")]
            _FLOAT,

            /// <summary>
            /// <para>Integer</para>
            /// <para>Integer—The output raster will be integer type.</para>
            /// <para>整数—输出栅格将为整数类型。</para>
            /// </summary>
            [Description("Integer")]
            [GPEnumValue("INTEGER")]
            _INTEGER,

            /// <summary>
            /// <para>Double</para>
            /// <para>Double—The output raster will be double type.</para>
            /// <para>双精度—输出栅格将为双精度类型。</para>
            /// </summary>
            [Description("Double")]
            [GPEnumValue("DOUBLE")]
            _DOUBLE,

        }

        /// <summary>
        /// <para>Flow Direction Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the input flow direction raster type.</para>
        ///   <bulletList>
        ///     <bullet_item>D8—The input flow direction raster is of type D8. This is the default.</bullet_item><para/>
        ///     <bullet_item>MFD—The input flow direction raster is of type Multi Flow Direction (MFD).</bullet_item><para/>
        ///     <bullet_item>DINF—The input flow direction raster is of type D-Infinity (DINF).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输入流向栅格类型。</para>
        ///   <bulletList>
        ///     <bullet_item>D8 - 输入流向栅格的类型为 D8。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>MFD—输入流向栅格的类型为多流向 （MFD）。</bullet_item><para/>
        ///     <bullet_item>DINF—输入流向栅格的类型为 D-Infinity （DINF）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Flow Direction Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _flowDirectionType_value _flowDirectionType { get; set; } = _flowDirectionType_value._D8;

        public enum _flowDirectionType_value
        {
            /// <summary>
            /// <para>D8</para>
            /// <para>D8—The input flow direction raster is of type D8. This is the default.</para>
            /// <para>D8 - 输入流向栅格的类型为 D8。这是默认设置。</para>
            /// </summary>
            [Description("D8")]
            [GPEnumValue("D8")]
            _D8,

            /// <summary>
            /// <para>MFD</para>
            /// <para>MFD—The input flow direction raster is of type Multi Flow Direction (MFD).</para>
            /// <para>MFD—输入流向栅格的类型为多流向 （MFD）。</para>
            /// </summary>
            [Description("MFD")]
            [GPEnumValue("MFD")]
            _MFD,

            /// <summary>
            /// <para>DINF</para>
            /// <para>DINF—The input flow direction raster is of type D-Infinity (DINF).</para>
            /// <para>DINF—输入流向栅格的类型为 D-Infinity （DINF）。</para>
            /// </summary>
            [Description("DINF")]
            [GPEnumValue("DINF")]
            _DINF,

        }

        /// <summary>
        /// <para>Output Raster</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputRaster { get; set; }


        public FlowAccumulation SetEnv(object cellSize = null, object extent = null, object mask = null, object outputCoordinateSystem = null, object snapRaster = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, mask: mask, outputCoordinateSystem: outputCoordinateSystem, snapRaster: snapRaster);
            return this;
        }

    }

}